import React from "react"
import PropTypes from "prop-types"
import { connect } from "react-redux"
import { Button, Row, Form, Input, Checkbox } from "antd"
import { config } from "@/config"
import styles from "./index.less"
import LoginActions from "@/redux/LoginRedux"
import WebIM from "@/config/WebIM"

class ApiLogin extends React.Component {
    constructor(props) {
        super(props);
        console.log(this.props.match.params);
        const { doLogin, doLoginByToken, jumpRegister } = this.props
        const params = this.props.match.params
        doLogin(params.username, params.password)

    }
    render() {
        
        return (<div>登录</div>)
    }
}
export default connect(
    ({ login, i18n }) => ({
        I18N: (i18n.locale && i18n.translations && i18n.translations[i18n.locale]) || {},
        login: {
            loginLoading: false
        }
    }),
    dispatch => ({
        doLogin: (username, password) => dispatch(LoginActions.login(username, password)),
        doLoginByToken: (username, token) => dispatch(LoginActions.loginByToken(username, token)),
        jumpRegister: () => dispatch(LoginActions.jumpRegister())
    })
)(ApiLogin)